cmake_minimum_required(VERSION 3.2)
project(Sensor)
set(CMAKE_CXX_STANDARD 17)
set(USE_TDENGINE TRUE)
set(USE_MQTT TRUE)
aux_source_directory(. code)
set(code ${code} discovery.h)

if(WIN32)
    find_package(Qt6 COMPONENTS REQUIRED Core Gui Widgets Network PATHS D:/Tools/Qt/6.6.0/msvc2019_64/lib/cmake)
else()
    find_package(Qt6 COMPONENTS REQUIRED Core Gui Widgets Network PATHS /root/sda/qt/6.8.0/gcc_arm64/lib/cmake)
endif()
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(QT_UIC_EXECUTABLE /usr/lib/x86_64-linux-gnu/qt5/bin/uic)
if(MSVC)
    add_compile_options(/EHa)
else()
    add_compile_options(-fexceptions)
endif()

add_executable(Sensor ${code})
target_link_libraries(Sensor Qt6::Core Qt6::Network)